package projetjee

import org.springframework.dao.DataIntegrityViolationException
import grails.plugins.springsecurity.Secured
import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils

import org.springframework.security.authentication.AccountExpiredException
import org.springframework.security.authentication.CredentialsExpiredException
import org.springframework.security.authentication.DisabledException
import org.springframework.security.authentication.LockedException
import org.springframework.security.core.context.SecurityContextHolder as SCH
import org.springframework.security.web.WebAttributes
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter

@Secured(['ROLE_ADMIN'])
class SecureController {

	def springSecurityService
	
	def index = {
		def springSecurityService
		def userTemp= springSecurityService.getCurrentUser()
		[userInstance: userTemp]
		//render 'Secure access only'
	}
}
